package com.zeei.ems.base.service.impl;

import java.util.HashMap;

import java.util.List;
import java.util.Map;

import com.zeei.ems.base.dao.WaterStatisticDao;
import com.zeei.ems.base.service.IWaterStatisticService;
import com.zeei.ems.base.util.WaterJudegUtil;
import com.zeei.ems.base.vo.*;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;



@Service("iWaterStatisticService")
public class WaterStatisticServiceImpl implements IWaterStatisticService {

	@Autowired
	private WaterStatisticDao waterStatisticDao;


	@Override
	public List<WaterGradesVO> getWaterDatas() {

		List<GradesCollVo> grades = waterStatisticDao.queryWaterGrades(null);

		return WaterJudegUtil.gradesToGra(grades);
	}

	/**
	 * queryWaterGrades:结果集转化，获取对应的查询审批标准
	 *
	 * @return List<WaterGradesVO>
	 */
	@Override
	public List<WaterGradesVO> queryWaterGrades(String secType) {

		Map<String, Object> params = new HashMap<>();
		// 湖泊专用的评价标准
		if ("[secType1]".equals(secType)) {
			params.put("secType", "timeType02");
		}

		List<GradesCollVo> grades = waterStatisticDao.queryWaterGrades(params);

		return WaterJudegUtil.gradesToGra(grades);

	}
}
